<template>
    <uni-popup ref="popRef" type="bottom" background-color="transparent" maskBackgroundColor="rgba(0, 0, 0, 0.6)">
        <view class="snowy-shadow snowy-padding">
            <view class="snowy-flex-end">
            	<icon type="clear" :size="20" color="#5677fc" @click="close"></icon>
            </view>
            <uni-forms ref="formRef" :model="searchFormData" label-position="top" labelWidth="auto">
                <uni-forms-item label="会议室门牌号" name="name">
                    <uni-easyinput v-model="searchFormData.name" placeholder="请输入会议室门牌号"></uni-easyinput>
                </uni-forms-item>
                <uni-forms-item label="会议室状态" name="state">
                	<snowy-sel-picker :map="{key: 'value', label: 'text'}" v-model="searchFormData.state" :rangeData="stateOptions" placeholder="请选择会议室状态"></snowy-sel-picker>
                </uni-forms-item>
                <uni-forms-item label="会议室类型" name="type">
                	<snowy-sel-picker :map="{key: 'value', label: 'text'}" v-model="searchFormData.type" :rangeData="typeOptions" placeholder="请选择会议室类型"></snowy-sel-picker>
                </uni-forms-item>
                <uni-forms-item label="负责人" name="fonPer">
                    <uni-easyinput v-model="searchFormData.fonPer" placeholder="请输入负责人"></uni-easyinput>
                </uni-forms-item>
            </uni-forms>
            <uni-row :gutter="10">
                <uni-col :span="12">
                    <tui-button height="90rpx" type="gray" @click="reset">重置</tui-button>
            	</uni-col>
            	<uni-col :span="12">
                    <tui-button height="90rpx" type="primary" @click="confirm">确认</tui-button>
            	</uni-col>
            </uni-row>
        </view>
    </uni-popup>
</template>
<script setup name="meetingInfoSearch">
    import { ref } from "vue"
    const emits = defineEmits(['reset', 'confirm'])
    const props = defineProps({
    	searchFormData: {
            type: Object,
            required: true
    	},
    })
    const stateOptions = uni.$snowy.tool.dictList('MEETINGROOM_STATUS')
    const typeOptions = uni.$snowy.tool.dictList('MEETINGROOM_TYPE')

    // 弹出ref
    const popRef = ref()
    // 打开
    const open = () => {
    	popRef.value.open()
    }
    const reset = () =>{
        // 重置数据
        props.searchFormData.name = ''
        props.searchFormData.state = ''
        props.searchFormData.type = ''
        props.searchFormData.fonPer = ''
    	emits('reset', props.searchFormData)
    }
    const confirm = () => {
    	popRef.value.close()
    	emits('confirm', props.searchFormData)
    }
    const close = () => {
    	popRef.value.close()
    }
    defineExpose({
    	open
    })
</script>
<style lang="scss" scoped>
</style>
